package core.api;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface CommunAPI extends Remote {

	/**
	 * Acquire the rigth to draw
	 * @param dest
	 * @param localId
	 * @param forme
	 */
	public void acquire(int source, int dest) throws RemoteException;

	/**
	 * Confirmed the rigth to draw
	 * @param dest
	 * @param localId
	 * @param forme
	 */
	public void confirmed(int source, int dest, int idForm) throws RemoteException;
	
	/**
	 * Release the right to draw
	 * @param dest
	 * @param localId
	 * @param forme
	 */
	public void release(int source, int dest) throws RemoteException;
	
	/**
	 * Send form to trace to others clients
	 * @param dest
	 * @param idForme
	 * @param forme
	 */
	public void sendToTrace(int source, int dest, int idForm, FormeAPI forme) throws RemoteException;
	
	/**
	 * Ask master to a other client
	 * @param source
	 * @param dest
	 * @throws RemoteException
	 */
	public void getMaster(int source, int dest) throws RemoteException;

	/**
	 * Answer the master
	 * @param source
	 * @param dest
	 * @param master
	 * @throws RemoteException
	 */
	public void setMaster(int source, int dest, int master) throws RemoteException;

	/**
	 * Ask forms to a other client
	 * @param source
	 * @param dest
	 * @throws RemoteException
	 */
	public void getForms(int source, int dest) throws RemoteException;
	
	/**
	 * Call protocol function to a client
	 * @param source
	 * @param dest
	 * @param method
	 * @param objects
	 * @throws RemoteException
	 */
	void callProtocol(int source, int dest, String method, Object ... objects) throws RemoteException ;

}
